#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int is(int number);
void count_sum(int a, int b);

int main() {
	int a, b;

	scanf("%d %d", &a, &b);
	if (is(a))
		printf("%d is counted.\n", a);
	if (is(b))
		printf("%d is counted.\n", b);
	count_sum(a, b);

	return 0;
}
int is(int number) {
	int N = 0;
	int tmp = number;
	int sum = 0;
	while (tmp) {
		tmp /= 10;
		N++;
	}
	for (int i = 0; i < N; i++) {
		tmp = number % 10;
		sum += tmp;
		number /= 10;
	}
	if (sum == 5)
		return 1;
	else
		return 0;
}

void count_sum(int a, int b) {
	int count = 0;
	int i;
	int sum = 0;
	for (i = a; i <= b; i++) {
		if (is(i)) {
			count++;
			sum += i;
		}
	}
	printf("count = %d, sum = %d", count, sum);
}